/*
* ============================================================================
*  Name        : example_008.h
*  Part of     : Finite state machine examples
*  Description : Class definition
*  Version     : %version: %
*  
*
* ============================================================================
*/
#if !defined(  __sm_example_008_h__ )
#define __sm_example_008_h__

#include <sea_statemachine>

using namespace sea;

/**
 * @file example_008.h
 * @brief Example of runtime compilation of a source file
 *
 * @ingroup StateMachineExamples
 *
 */
namespace sea_examples
{
    /**
     * @class MyCompiler
     * @brief \b Examples: Demonstrates state machine compiler, running in \b 'parser' mode
     *
     * @ingroup StateMachineExamples
     */
    class MyCompiler : public StateMachine
    {
    public:
        MyCompiler( ) : StateMachine( STATEMACHINE_NAME ){ }

    private:
        ACT( MyCompiler, init );
        ACT( MyCompiler, ParseBinarySm );
        ACT( MyCompiler, readString );
        ACT( MyCompiler, getLiteral );
        ACT( MyCompiler, createStateMachine );
        ACT( MyCompiler, storeExecMode );
        ACT( MyCompiler, createState );
        ACT( MyCompiler, storeHeartBeatInterval );
        ACT( MyCompiler, storeHeartBeats );
        ACT( MyCompiler, createEventRecord );
        ACT( MyCompiler, storeEvent );
        ACT( MyCompiler, storeAction );
        ACT( MyCompiler, storeNextState );
        ACT( MyCompiler, endOfState );
        ACT( MyCompiler, complete );
        ACT( MyCompiler, error );
        ACT( MyCompiler, resolveNextStates ) ;

        EVENT_INT( MyCompiler, Ev_Int_InitOk );
        EVENT_INT( MyCompiler, Ev_Int_InitBinaryOk );
        EVENT_INT( MyCompiler, Ev_Int_InitFailed );
        EVENT_INT( MyCompiler, Ev_Int_ParseError );
        EVENT_INT( MyCompiler, Ev_Int_Eol );
        EVENT_INT( MyCompiler, Ev_Int_Eof );
        EVENT_INT( MyCompiler, Ev_Int_NotEmptyString );
        EVENT_INT( MyCompiler, Ev_Int_GotNumber );
        EVENT_INT( MyCompiler, Ev_Int_GotName );
        EVENT_INT( MyCompiler, Ev_Int_GotOpenBracket );
        EVENT_INT( MyCompiler, Ev_Int_GotCloseBracket );
        EVENT_INT( MyCompiler, Ev_Int_ResolveOk );
        EVENT_INT( MyCompiler, Ev_Int_ParseWarning );
    };

    void launch_example_008( );
}

#endif
